var e = require("../../@babel/runtime/helpers/interopRequireDefault"), t = e(require("../../@babel/runtime/regenerator")), n = require("../../@babel/runtime/helpers/asyncToGenerator"), r = require("../../utils/switchTab"), i = (require("../../utils/tool"), 
e(require("../../http/info"))), a = e(require("../../http/system")), o = getApp(), s = new i.default(), u = new a.default();

Page({
    data: {
        loginInfo: "",
        cellList: [ {
            title: "订单"
        } ],
        noticeText: "",
        sit: !1
    },
    onShow: function() {
        o.global.isLogin() && (this.getLoginInfo(), this.getOtherUserInfo()), this.getNoticeText(), 
        (0, r.switchToTab)(this, 4);
    },
    serviceOnTap: function() {
        wx.openCustomerServiceChat ? wx.openCustomerServiceChat({
            extInfo: {
                url: "https://work.weixin.qq.com/kfid/kfc62fc4b01bf0201c2"
            },
            corpId: "wxce8626b0634b4850",
            success: function(e) {},
            fail: function(e) {
                console.log("openCustomerServiceChat fail:", e);
            }
        }) : o.showAlert("提示", "当前微信版本过低，无法使用该功能，请升级到最新微信版本后重试。");
    },
    getLoginInfo: function() {
        var e = this;
        return n(t.default.mark(function n() {
            var r;
            return t.default.wrap(function(t) {
                for (;;) switch (t.prev = t.next) {
                  case 0:
                    return t.next = 2, s.getUmsMemberInfo();

                  case 2:
                    r = t.sent, e.setData({
                        loginInfo: r.data
                    });

                  case 4:
                  case "end":
                    return t.stop();
                }
            }, n);
        }))();
    },
    getOtherUserInfo: function() {
        var e = this;
        return n(t.default.mark(function n() {
            var r;
            return t.default.wrap(function(t) {
                for (;;) switch (t.prev = t.next) {
                  case 0:
                    return t.next = 2, s.otherUserInfo();

                  case 2:
                    r = t.sent, e.setData({
                        otherInfo: r.data
                    });

                  case 4:
                  case "end":
                    return t.stop();
                }
            }, n);
        }))();
    },
    getNoticeText: function() {
        var e = this;
        return n(t.default.mark(function n() {
            var r;
            return t.default.wrap(function(t) {
                for (;;) switch (t.prev = t.next) {
                  case 0:
                    return t.next = 2, u.getSystemConfig("scrollNews");

                  case 2:
                    r = t.sent, e.setData({
                        noticeText: r.data.configValue
                    });

                  case 4:
                  case "end":
                    return t.stop();
                }
            }, n);
        }))();
    },
    toFanBase: function() {
        wx.navigateTo({
            url: "/pages/webview/webview?url=https://mp.weixin.qq.com/s/Fmn2qCvmTxiS_eqbPMUDTw"
        });
    },
    toAccount: function() {
        wx.navigateTo({
            url: "/pages/webview/webview?url=https://mp.weixin.qq.com/s/aErXewaNGaMPA5sSFdlD8w"
        });
    },
    showSit: function() {
        this.setData({
            sit: !0
        });
    }
});